﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using Model.CommonModel.PageModel;
using Model.EntityModel.Auth;
using Model.EntityModel.SysModel;
using Model.QueryModel.system;
using SqlSugar;

namespace Service.IService.ISysService
{
    public interface IUserService
    {
        User GetUserById(string userId);
        User GetUserByUsername(string username);
        bool CreateUser(User user);
        bool UpdateUser(User user);
        bool UpdateUserStatus(string userId, string status);
        bool UpdatePassword(string userId, string newPassword);
        List<User> GetUsersByDepartment(string deptCode);
        bool AddGroupsToUser(string userId, List<string> groupIds);
        bool RemoveGroupsFromUser(string userId, List<string> groupIds);
        List<Group> GetUserGroups(string userId);
        List<Group> GetAvailableGroupsForUser(string userId);
        PagedInfo<User> GetUserPage(int pageNum, int pageSize, QueryUser search);
        Task<PagedInfo<User>> GetPagedUsersAsync(Expression<Func<User, bool>> whereExpression, int pageIndex = 1, int pageSize = 20,
            Expression<Func<User, object>> orderByExpression = null, OrderByType orderByType = OrderByType.Asc);
    }
}
